<?php
	echo $this->inlineScript()->setScript('
		linkProductArray = ' . Zend_Json::encode( $this->linkProductsList ) . ';
	');
?>
<h2 style="padding-top: 30px;">Powiązane produkty</h2>
<div style="position:relative;" class="bglist">
	<div id="bgbgbg"></div>
	<div id="listabg" class="bglistq">
		<table cellspacing="1" cellpadding="6" class="tlist">
			<tr>
				<td colspan="2" id="letter" class="inpy">
					<?php 
						$lt = array( 
							'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
							'J', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S',
							'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '0-9', 'WSZYSTKIE' 
						); 
					?>
					<?php foreach( $lt as $value ) { ?>
					<a <?php echo ( $this->filtrn == $value ) ? 'style="font-weight:bold;"' : '' ?> href="<?php echo $this->baseUrl() ?>/cpproducts/getproducts/filtr/<?php echo $value; ?>"><?php echo $value; ?></a>
					<?php } ?>  
				</td>
			</tr>
			<?php foreach( $this->list as $item ) { ?>
			<tr>
				<td>
					<label class="linkproducts">
						<?php if( $this->special ) { ?>
							<?php $checked = in_array( $item['ps_id'], $this->linkProductsList ) ? 'checked="checked"' : ''; ?>
							<input <?php echo $checked; ?> type="checkbox" name="lp[]" value="<?php echo $item['ps_id'] ?>" /> 
							<?php echo $item['name_pl'] ?>
						<?php } else { ?>
							<?php $checked = in_array( $item['p_id'], $this->linkProductsList ) ? 'checked="checked"' : ''; ?>
							<input <?php echo $checked; ?> type="checkbox" name="lp[]" value="<?php echo $item['p_id'] ?>" /> 
							<?php echo $item['name_pl'] ?>
						<?php } ?>
					</label>
				</td>
			</tr>
			<?php } ?>
			
			<tr>
				<td id="pagerajax" colspan="2">
				<?php  echo $this->render('global/pager.phtml'); ?>
				</td>
			</tr>
		</table>
	</div>
</div>
